package day27;

import java.io.IOException;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Scanner;

public class Client2 {
    public static void main(String[] args) throws IOException {
        //1.创建客户端对象
        Socket client = new Socket("192.168.9.88",9999);
        //手动输入
        OutputStream os = client.getOutputStream();
        Scanner sc = new Scanner(System.in);
        while(true){
            System.out.println("请输入你要写入的数据:");
            String line = sc.nextLine();
            os.write((line+"\n").getBytes());
        }
    }
}
